#!/usr/bin/perl

use strict;

my $file = '/etc/dat/scsi_id.dat';

if (@ARGV > 1) {
    open FILE, $file or die "No file\n";

    my $MATCH_DEV = qr/$ARGV[1]$/;

    while (my $line = <FILE>) {
        if ($line =~ $MATCH_DEV) {
            my @fields = split /\s+/, $line, 2;
            print "$fields[0]\n";
        }
    }
    close FILE;
}
